#ifndef __WEB_SERVER_H__
#define __WEB_SERVER_H__

#include "config.h"

#ifdef WEB_SERVER_ASYNC
#include <ESPAsyncWebServer.h>
#include <AsyncTCP.h>

void handleRoot(AsyncWebServerRequest *request);
void handleDownload(AsyncWebServerRequest *request);
void handleDownload_v2(AsyncWebServerRequest *request);
void handleDataInfo(AsyncWebServerRequest *request);
void flushAsyncTCP(AsyncWebServerRequest *request);
#else
void handleRoot();
void handleDownload();
void handleDataInfo();
#endif

void web_server_start(void);
void web_server_stop(void);

void web_server_init(void);
void web_server_loop(void);
#define CHUNK_SIZE 50 // 每次处理x条记录



#endif